<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
ul{list-style:none;}
li{padding:5px;}
</style>
</head>
<body style="background: url(xxx.png)">

    <br><script type="text/javascript">
    function validate(){
    	if(form1.file.value == ""){
    		alert("请选择要上传的文件");
    		return false;
    	}
    }
    </script>
    <center>
    <form action="UploadServlet" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return validate()">

    <ul>
          <li>请选择要上传的附件</li>
          <li>上传文件：<input type="file" name="file"/></li>
          <li><input type="submit" name="submit" value="上传">
          &nbsp;
          <input type="reset" name="Submit2" value="重置"></li>
    </ul>
    <%
      if(request.getAttribute("result") != null){
    	  out.println("<script>alert('"+request.getAttribute("result")+"');</script>");
      }
    %>
    </form>
    
    </center>
    <center>
    <hr>
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <input type="button" value="返回上一级" onclick="window.location.href='add.jsp'" />
    <!--  <a href="?act=method">返回上一级</a>  -->
    </center>
</body>
</html>